package com.muye.adapter;

import java.util.List;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.muye.dianli.fragment.Fragment0ViewPagerFragment;

/**
 * 首页广告栏适配器
 * 
 * @author TangChao
 *
 */
public class Fragment0ViewPagerAdapter extends FragmentPagerAdapter
{
	private List<Fragment0ViewPagerFragment> arrayList;
	
	public Fragment0ViewPagerAdapter(FragmentManager fm, List<Fragment0ViewPagerFragment> arrayList)
	{
		super(fm);
		this.arrayList = arrayList;
	}
	
	public Fragment0ViewPagerAdapter(FragmentManager fm)
	{
		super(fm);
	}
	
	@Override
	public Fragment0ViewPagerFragment getItem(int arg0)
	{
		if (arrayList != null)
		{
			return arrayList.get(arg0);
		}
		return null;
	}
	
	@Override
	public int getCount()
	{
		if (arrayList != null)
		{
			return arrayList.size();
		}
		return 0;
	}
	
}
